/**
 * 管理商品
 */
var v_goods = new Vue({
	el: '#goodsListPage',
	data: {
		title: '商品管理',
		needBack: false,
		needRefresh: false,
		navs: [{
			title: '代理商审核',
			icon: 'icon-tuandui',
			url: '/admin',
			active: '',
			badge: 0
		}, {
			title: '商品管理',
			icon: 'icon-shangpin',
			url: '/admin/goods',
			active: 'active',
			badge: 0
		}, {
			title: '订单管理',
			icon: 'icon-dingdan',
			url: '/admin/order',
			active: '',
			badge: 0
		}],
		goodses: []
	},
	created: function() {
		this.init();
	},
	methods: {
		init: function() {
			this.loadGoods();
		},
		logout: function() {
			self.location.href = '/logout';
		},
		loadGoods: function() {// 加载商品信息
			// 因为数量少，不考虑分页
			axios.post('/goods/admin/list')
				.then(function(resp) {
					if (resp.data.success) {
						v_goods.goodses = resp.data.rows;
					}
				})
				.catch(function (error) {
				    console.log(error);
				});
		},
		changeInv: function() {
			
		}
	}
});